#import "FoursquareTipAnnotation.h"

/**
 * A FoursquareTipAnnotation is a single tip in the Foursquare
 * system represented as a map annotation for an MKMapView. 
 * 
 * @author      James Lin
 * @version     2.2.2
 * @since       2.2.2
 * @see         AddressAnnotation
 */
@implementation FoursquareTipAnnotation

@synthesize tipInfo; // Info for the tip

/**
 * Initialize the Foursquare tip annotation.
 *
 * @param tip  the Foursquare tip
 * @return     the initialized Foursquare tip annotation
 */
- (id)initWithTip:(FoursquareTip*)tip {
	if (self = [super initWithType:AnnotationTypeFoursquareTip]) {
		self.tipInfo = tip;
		[super setCoordinate:tip.tipLocation];
		[super setTitle:tip.tipText];
		[super setSubtitle:[NSString stringWithFormat:@"%@ %@", 
							tip.tipUserFirstName, tip.tipUserLastName]];
	}
	
	return self;
}

/**
 * Deallocate the Foursquare tip annotation.
 */
- (void)dealloc {
	[tipInfo release], tipInfo = nil;
	[super dealloc];
}

@end
